﻿namespace Shot.Presentation.Foundation
{
    /// <summary>
    /// Implementation of IPresentationManager, which presents implementations of IPresenter to a client by triggering
    /// the Before, Present, and After methods on the presenter. Also sets the presenter's Instance property automatically.
    /// </summary>
    public class PresentationManager : IPresentationManager
    {
        /// <summary>
        /// App Instance
        /// </summary>
        public App App { get; set; }

        /// <summary>
        /// Present an implementation of IPresenter to an AppInstance
        /// </summary>
        /// <param name="presenter"></param>
        /// <param name="client"></param>
        public void PresentFor(IPresenter presenter, AppInstance client)
        {
            presenter.Instance = client;

            presenter.Before();
            presenter.Present();
            presenter.After();
        }
    }
}
